import 'dart:math';

import 'package:word_game/engine/core.dart';
import 'package:word_game/battle/battle.dart';

class RoarSkill extends Skill {
  RoarSkill() : super('怒吼') {
    Debuff shock = Debuff();
    shock.name = '震慑';
    shock.lastRound = 2;
    shock.attackPowerDecrement = 20;
    debuffs = [shock];
    Buff heal = Buff();
    heal.name = '吸血';
    heal.lastRound = 5;
    heal.vitalityIncrement = 20;
    buffs.add(heal);
  }

  @override
  List<Monster> determineTargets(List<Monster> alternatives) {
    if (alternatives == null || alternatives.length == 0) {
      return null;
    }
    int index = Random.secure().nextInt(alternatives.length);
    return [alternatives[index]];
  }

  @override
  AttackAction determineAction(Hero hero) {
    AttackAction action = AttackAction();
    action.attackType = DamageType.physical;
    action.attackNumber = hero.attackPower * 2;
    return action;
  }
  
}